﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ByHand.Services.Code
{
    public enum EOrderStatus
    {
        Order_New = 0,
        Order_WaitPay = 1,
        Order_PayFail = 2,
        Order_PaySuccess = 3,
        Order_WaitDeliver = 4,
        Order_Done = 5,
        Order_COD_Wait = 6,
        Order_BankTransfer_Wait = 7,
        Order_Failed = 8,
        Order_GuuSuccess = 9,
        Order_GuuFail = 10
    }
    public enum EPayType
    {
        None = 0,
        SoHaPay = 1,
        CardPay = 2,
        ByHandPay = 3,
        SoHaPayVisa = 4,
        SoHaPayMaster = 5,
        COD = 6,
        BankTransfer = 7
    }
    public class CheckOrderProblem
    {
        public CheckOrderProblem()
        {

        }
        public bool CheckTrustAddress(string address)
        {
            Regex regex = new Regex("(.+\\s){3,}");
            var result = regex.Matches(address);
            if (result.Count <= 0)
            {
                return false;
            }
            regex = new Regex("\\d+");
            result = regex.Matches(address);
            if (result.Count <= 0)
            {
                return false;
            }
            return true;
        }
        public bool CheckTrustName(string name)
        {
            Regex regex = new Regex("((.{2,}\\s){2,}||((.{2,})+\\s.{2,}))");
            var result = regex.Matches(name);
            if (result.Count <= 0)
            {
                return false;
            }
            return true;
        }

    }

}
